Skip to content

fix(gateway): refuse writes under a lease that is no longer held - #1601

Merged
kvinwang merged 1 commit into
nextfrom
fix/gateway-lease-before-commit
Nov 18, 2026
Merged

kvinwang merged 1 commit into
nextfrom
fix/gateway-lease-before-commit

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

Work under a renew or ACME-account lease was not bounded by the lease. Past its expiry (or after a force release) a peer may take over, and both holders would commit.

  • KvStore::{cert,rotation}_lock_still_held checks the condition release_lock uses: the stored value is ours and the lease is unexpired by the local clock. It is checked right before each irreversible write under a lease: saving the certificate and its attestation, publishing ACME credentials and their attestation (rotation and first-use registration), and each CAA write. A lost lease aborts with an error instead.
  • renew_timeout is capped at half the renew lease (300 s, the current default), leaving the other half for the work around the order and clock skew. Enforced in SetCertbotConfig.

The check and the write are still two steps; across nodes this stays best-effort (no CAS in WaveKV), but a holder no longer commits after its lease is gone.

Stacked on #1600; only the last commit is new.

kvinwang added a commit that referenced this pull request Nov 18, 2026
CertLock follows #1599-#1601 on wavekv 2.2: the lock value carries a
nonce, a lease stamped beyond the drift bound counts as expired, and
release and lease-guarded writes are no-ops once the lease expired by the
local clock. The force-release, clock-step-back and stale-release
counterexamples become positive theorems: ownership on one node under any
clock, and a release or guarded commit losing LWW to any successor whose
clock is within the drift bound. The replication gap, skew beyond the
drift bound, and cross-node force release remain as counterexamples.

Sni follows #1602: the returned name lies within every declared block.
CertStore follows #1603: no exact-match table, empty first label refused.

Signed-off-by: Kevin Wang <wy721@qq.com>
@kvinwang
kvinwang force-pushed the fix/gateway-lease-before-commit branch from e68a9f8 to 357c8cf Compare November 18, 2026 08:46
@kvinwang
kvinwang enabled auto-merge November 18, 2026 08:46
@kvinwang
kvinwang merged commit c4c7890 into next Nov 18, 2026
21 checks passed
@kvinwang
kvinwang deleted the fix/gateway-lease-before-commit branch November 18, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant